package com.yonyou.pmclouds.billview.rmiimpl.buzi;

import com.yonyou.pmclouds.basecom.consts.BillTypeConst;
import com.yonyou.pmclouds.basecom.entity.PageObject;
import com.yonyou.pmclouds.basecom.entity.SuperVO;
import com.yonyou.pmclouds.basecom.exception.BusinessException;
import com.yonyou.pmclouds.billview.entity.BillViewQueryVO;
import com.yonyou.pmclouds.billview.rmitf.IBillViewBuziService;
import com.yonyou.pmclouds.stagecheck.entity.StageCheckVO;
import com.yonyou.pmclouds.stagecheck.rmitf.StageCheckQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author chulf
 * @Date 2020/4/3
 * @Description
 **/
@Component
public class StageCheckBuziServiceImpl implements IBillViewBuziService {

    @Autowired
    private StageCheckQuery stageCheckQuery;

    @Override
    public String getBillType() {
        return BillTypeConst.STAGECHECK_BILLTYPE;
    }

    @Override
    public PageObject<Object> queryBillList(BillViewQueryVO billViewQueryVO) throws BusinessException {

        PageObject<Object> pageObject = stageCheckQuery.queryByCondition(billViewQueryVO.getPkProject(), billViewQueryVO.getCreators(),
                billViewQueryVO.getStartTime(), billViewQueryVO.getEndTime(), billViewQueryVO.getBillStatus(), billViewQueryVO.getPageStart(), billViewQueryVO.getPageSize());
        return pageObject;
    }

    @Override
    public SuperVO queryBillDetail(String pkBill) throws BusinessException {

        StageCheckVO stageCheckVO = stageCheckQuery.queryOneByPk(pkBill);
        //这里边具体在联调预览时处理里边的特别字段

        return stageCheckVO;
    }
}
